#include "cmsis_os2.h"
#include "lvgl.h"


extern osMutexId_t LvglMutexHandle;

void StartLvglTask(void *argument)
{
    osMutexAcquire(LvglMutexHandle, osWaitForever);
    lv_obj_t* label = lv_label_create(lv_scr_act());
    lv_obj_set_style_text_font(label, &lv_font_montserrat_24, LV_STATE_DEFAULT); // 设置 24 号字体
    lv_label_set_text(label, "Hello world!");
    osMutexRelease(LvglMutexHandle);

    for(;;)
    {
        osMutexAcquire(LvglMutexHandle, osWaitForever);
        lv_timer_handler();
        osMutexRelease(LvglMutexHandle);
        osDelay(5);
    }
}
